package adc.budget.ui.web.wicket;

import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
import org.apache.wicket.markup.repeater.RepeatingView;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.request.resource.PackageResourceReference;

import adc.app.ui.wicket.AbstractLayoutPage;
import adc.app.ui.wicket.PageLabeledLinkPanel;
import adc.budget.ui.web.wicket.account.IMsgsAccount;
import adc.budget.ui.web.wicket.category.IMsgsCategory;
import adc.budget.ui.web.wicket.transaction.IMsgsTransaction;

public class LayoutPage extends AbstractLayoutPage {

    private static final long serialVersionUID = 1L;

    protected LayoutPage() {
        super();
    }

    protected LayoutPage(IModel<?> model) {
        super(model);
    }


    protected LayoutPage(PageParameters parameters) {
        super(parameters);
    }

    @Override
    protected void addMenus(RepeatingView menus) {
        menus.add(new PageLabeledLinkPanel<AccountTypePage>(menus.newChildId(), AccountTypePage.class,
                new ResourceModel(IMsgsAccount.ACCOUNT_TYPES)));
        menus.add(new PageLabeledLinkPanel<AccountPage>(menus.newChildId(), AccountPage.class,
                new ResourceModel(IMsgsAccount.ACCOUNTS)));
        menus.add(new PageLabeledLinkPanel<CategoryPage>(menus.newChildId(), CategoryPage.class,
                new ResourceModel(IMsgsCategory.CATEGORIES)));
        menus.add(new PageLabeledLinkPanel<TransactionPage>(menus.newChildId(), TransactionPage.class,
                new ResourceModel(IMsgsTransaction.TRANSACTIONS)));
    }

    @Override
    protected String getAppNameKey() {
        return "budget";
    }

    @Override
    public void renderHead(HtmlHeaderContainer container) {
        super.renderHead(container);
        container.getHeaderResponse().renderCSSReference(new PackageResourceReference(LayoutPage.class, 
                "css/specifics.css"), "screen");
    }    

}

